﻿using ch09.binary.type;

namespace ch09.binary.interpreter
{
    public class GlobalVar
    {
        internal GlobalType Type;
        public ulong Val;

        public ulong GetAsU64()
        {
            return Val;
        }
        
        public   void SetAsU64(ulong val ) {
            if (Type.Mut != 1)
            {
                Panic.Run(Errors.ErrImmutableGlobal);
            }

            this.Val = val;
        }

    }
}